package com.fenxiangtech.mall.web.controller.v1;

import com.fenxiangtech.mall.entity.Banner;
import com.fenxiangtech.mall.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhangjiashun
 */
@Controller("bannerControllerV1")
@RequestMapping("/v1/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    @GetMapping("/{id}")
    @ResponseBody
    public Banner getBannerById(@PathVariable("id") Long id) {
        return bannerService.getBannerById(id);
    }

}
